import time as t

import cv2

scale = int(input("set scale"))
set_time = int(input("set time: "))
print(f"Time Setting {set_time} s")
# time_conter=set_time/scale
time_start = t.perf_counter()
start = "START"
end = "END"
print(f"{start:-^{scale + 14}}")
for j in range(set_time + 1):
    time_pass = t.perf_counter() - time_start
    i = (int)(time_pass / set_time * scale)
    star = "#" * i
    dot = " " * (scale - i)
    print(f"\r{i * 100 / scale}%[{star}{dot}]{time_pass:.2f}s", end="")
    t.sleep(1)

print()
print(f"{end:-^{scale + 14}}")

time_counter = 0
flag = True
while flag:
    time_counter += 1
    # t.sleep(1)
    cv2.imshow(" ",cv2.imread("../../IMG/93852527_p0.jpg"))
    key_press = cv2.waitKey(1000)
    if 27 == key_press:
        flag = False
    print(f"\r{time_counter} s", end="")

cv2.destroyAllWindows()
